<!--
*@Author: QWP
*@Description: 查询表单
*@Date: 2024-07-08 14:20:00
-->
<template>
  <a-row v-bind="$attrs"
    class="u-common-search-form">
    <a-row>
      <a-form-item
        v-for="fItem in elements"
        :name="fItem.key"
        :label="fItem.label"
        v-bind="fItem.formItemProps">
        <component
          :is="componentsMap[fItem.element]"
          v-bind="fItem.componentProps"
          v-model:value="$attrs.model[fItem.key]" />
      </a-form-item>
      <slot name="start"></slot>
    </a-row>
    <a-row justify="end">
      <slot name="end"></slot>
    </a-row>
  </a-row>
</template>

<script lang='ts' setup>
defineOptions({
  name: 'u-search-form'
})
import { ref, reactive, computed, onMounted } from 'vue' 
import { useRoute, useRouter } from 'vue-router'
import type { Rule } from "ant-design-vue/es/form";
import { componentsMap } from "../form/config";
import { _IFormEl } from '../form//interface.ts'

interface Props {
  elements: Array<_IFormEl>;
}
defineProps<Props>();
</script>

<style lang='scss' scoped>
.u-common-search-form {
  .ant-form-item {
    margin-bottom: 12px
  }
  .ant-picker {
    width: 100%
  }
}
</style>